package IO.xml;

import java.io.File;

import librairies.liste.interfaces.IListeE;
import modele.Mot;
import IO.xml.comprehension.ComprehensionHandler;

import commande.Lien;

public class XmlComprehension 
{
	private File file;
	private ComprehensionHandler sax;
	
	private static XmlComprehension instance;
	
	private XmlComprehension(String fich)
	{
		this.file = new File(fich);
		this.sax = new ComprehensionHandler(this.file);
	}
	
	/**
	 * pour le singleton
	 */
	public static XmlComprehension getInstance() 
	{
		if (instance == null) 
		{
			Lien lien = Lien.getInstance();
			instance = new XmlComprehension(lien.getDossierDico() + "comprehension.xml");
		}
		return instance;
	}
		
	public boolean ecriture(IListeE<Mot> xml) 
	{
		//TODO a faire un jour.
		return true;
	}

	public IListeE<Mot> lecture() 
	{
		return this.sax.lecture();
	}
}
